package sample.pages;

import org.dreamwork.jasmine2.events.EventException;
import org.dreamwork.jasmine2.web.controls.Page;
import sample.controls.MyControl;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * Created by IntelliJ IDEA.
 * User: seth.yang
 * Date: 12-3-19
 * Time: 下午9:29
 */
public class MyControlPage extends Page {
    protected MyControl c1;

    protected List<Map<String, String>> data;

    public MyControlPage () {
        data = new ArrayList<Map<String, String>> ();
        for (int i = 0; i < 5; i ++) {
            Map<String, String> map = new HashMap<String, String> ();
            map.put ("title", "无症状" + i);
            map.put ("type", "checkbox");
            map.put ("value", String.valueOf (i));
            data.add (map);
        }
    }

    @Override
    public void onPagePreload (Page page) throws EventException {
        super.onPagePreload (page);    //To change body of overridden methods use File | Settings | File Templates.
    }

    @Override
    public void onPageLoad (Page page) throws EventException {
        super.onPageLoad (page);    //To change body of overridden methods use File | Settings | File Templates.
    }

    @Override
    public void onPageLoadCompleted (Page page) throws EventException {
        try {
            dataBind ();
        } catch (Throwable throwable) {
            throwable.printStackTrace ();  //To change body of catch statement use File | Settings | File Templates.
        }
    }
}
